package 对象数组;

/*
 * 需求：
 * 定义一个数组，用来存放3个person对象
 *
 * */
public class Array {
    public static void main(String[] args) {
        person[] array = new person[3];
        person one = new person("lee", 20);
        person two = new person("zhang", 10);
        person three = new person("wang", 30);
        array[0] = one;
        array[1] = two;
        array[2] = three;
        System.out.println(array[0].age);
    }
}
